import Vue from 'vue'
const axios = Vue.prototype.$axios
const wxLogin = (data) => {
  return axios.post('/public/wxLogin', data)
}
const appPhoneLogin = (data) => {
  return axios.post('/public/appPhoneLogin', data)
}
const login = (data) => {
  return axios.post('/public/login', data)
}
const addPassword = (data) => {
  return axios.post('/public/addPassword', data)
}
const sendCode = (data) => {
  return axios.get('/public/sendCode', data)
}
const mobileLogin = (data) => {
  return axios.post('/public/mobileLogin', data)
}
const refresh = (data) => {
  return axios.get('/public/refresh', data)
}
const getCaptcha = (data) => {
  return axios.get('/public/getCaptcha', data)
}
const register = (data) => {
  return axios.post('/public/register', data)
}
const updateUserInfo = (data) => {
  return axios.post('/user/wxBasic', data)
}
const getAllSign = (data) => {
  return axios.get('/user/getAllSign', data)
}
const signIn = (data) => {
  return axios.get('/user/fav', data)
}
const addAddress = (data) => {
  return axios.post('/user/addAddress', data)
}
const getAddress = (data) => {
  return axios.post('/user/getAddress', data)
}
const deleteAddress = (data) => {
  return axios.post('/user/deleteAddress', data)
}
const changeDefault = (data) => {
  return axios.post('/user/changeDefault', data)
}
const addOrder = (data) => {
  return axios.post('/user/addOrder', data)
}
const delOrder = (data) => {
  return axios.post('/user/delOrder', data)
}
const getUnpaidOrder = (data) => {
  return axios.post('/user/getUnpaidOrder', data)
}
const paid = (data) => {
  return axios.post('/user/paid', data)
}
const getOrderList = (data) => {
  return axios.post('/user/getOrderList', data)
}
const getMyPost = (data) => {
  return axios.get('/user/getMyPost', data)
}
const deletePost = (data) => {
  return axios.get('/user/deletePost', data)
}
const getCity = (data) => {
  return axios.get('/public/getCity', data)
}
export {
  wxLogin,
  appPhoneLogin,
  addPassword,
  getCaptcha,
  login,
  getCity,
  sendCode,
  mobileLogin,
  refresh,
  register,
  updateUserInfo,
  getAllSign,
  signIn,
  addAddress,
  getAddress,
  deleteAddress,
  changeDefault,
  addOrder,
  getUnpaidOrder,
  paid,
  delOrder,
  getOrderList,
  getMyPost,
  deletePost
}